from tortoise import fields
from tortoise.models import Model
from datetime import datetime

class Wish(Model):
    id = fields.IntField(pk=True)
    title = fields.CharField(max_length=100)
    content = fields.TextField()
    status = fields.IntField(default=0)  # 0: 未完成, 1: 已完成
    user = fields.ForeignKeyField('models.User', related_name='wishes')
    created_at = fields.DatetimeField(auto_now_add=True)
    updated_at = fields.DatetimeField(auto_now=True)

    class Meta:
        table = "wishes" 